<?php
/**
 * Description of LoginForm
 * Formulario para el inicio de sesion (signin) en el sistema [frontend]
 * @author rmariano
 */
class LoginForm extends sfFormSymfony {

    public function  setup() {
        //parent::setup();
        $this->setWidgets(array(
            'username' => new sfWidgetFormInputText(),
            'password' => new sfWidgetFormInputPassword(array('type' => 'password')),
            'remember' => new sfWidgetFormInputCheckbox()
        ));

        $this->setValidators(array(
            'username' => new sfValidatorString(),
            'password' => new sfValidatorString(),
            'remember' => new sfValidatorBoolean()
        ));
        $this->validatorSchema->setPostValidator(new ValidatorDeUsuario());
        $this->widgetSchema->setNameFormat('signin[%s]');
        
    }
    public function configure()
    {
    $this->setWidgets(
            array('nombre_usuario' => new sfWidgetFormInput(),
                  'password' => new sfWidgetFormInputPassword() ));
    $this->widgetSchema->setNameFormat('login[%s]');
    $this->setValidators(
        array(
       'nombre_usuario' => new sfValidatorChoice(array('required' => true,'choices' => array('admin'))),
       'password' => new sfValidatorChoice(array('required' => true,'choices' => array('admin')))
            ));
    }
    
}
?>
